package com.rain.example.verifyPermissions.controller;

import com.rain.example.verifyPermissions.models.user.User;
import com.rain.example.verifyPermissions.response.Result;
import com.rain.example.verifyPermissions.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @GetMapping("listUser")
    public Result listUser() {
        List<User> list = userService.list();
        return Result.success(list);
    }
}
